package com.hua.nailcampus.acl.controller;

import com.hua.nailcampus.acl.model.City;
import com.hua.nailcampus.acl.service.CityService;
import com.hua.nailcampus.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author:chenjianhua
 * @Date:2023/11/22 22:43
 * @Version 1.8
 */
@RestController
@RequestMapping("nailCampus/city")
@CrossOrigin
public class CityController {

    @Autowired
    private CityService cityService;

    @GetMapping("/getAllCities/{pId}")
    public Result getAllCities(@PathVariable Integer pId) {
        List<City> cityList = cityService.getAllCities(pId);
        return Result.ok(cityList);
    }

}
